package com.example.demo.domain.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 回复表
 * @TableName reply
 */
@TableName(value ="reply")
@Data
public class Reply implements Serializable {
    /**
     * 
     */
    @TableId
    private Long id;

    /**
     * 讨论帖子id
     */
    private Long communicationId;

    /**
     * 评论id
     */
    private Long commentId;

    /**
     * 被回复内容
     */
    private String text;

    /**
     * 回复内容
     */
    private String toText;

    /**
     * 
     */
    private Date time;

    /**
     * 点赞数量
     */
    private Integer likeNum;

    /**
     * 收藏数量
     */
    private Integer favorNum;

    /**
     * 被回复用户id
     */
    private Long userId;

    /**
     * 回复用户id
     */
    private Long toUserId;

    /**
     * 被回复用户名称
     */
    private String userName;

    /**
     * 回复用户名称
     */
    private Integer toUserName;

    /**
     * 被回复用户昵称
     */
    private String userNickName;

    /**
     * 回复用户昵称
     */
    private Integer toUserNickName;

    /**
     * 1 审核中 2 正常 3 删除
     */
    private Integer status;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Reply other = (Reply) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getCommunicationId() == null ? other.getCommunicationId() == null : this.getCommunicationId().equals(other.getCommunicationId()))
            && (this.getCommentId() == null ? other.getCommentId() == null : this.getCommentId().equals(other.getCommentId()))
            && (this.getText() == null ? other.getText() == null : this.getText().equals(other.getText()))
            && (this.getToText() == null ? other.getToText() == null : this.getToText().equals(other.getToText()))
            && (this.getTime() == null ? other.getTime() == null : this.getTime().equals(other.getTime()))
            && (this.getLikeNum() == null ? other.getLikeNum() == null : this.getLikeNum().equals(other.getLikeNum()))
            && (this.getFavorNum() == null ? other.getFavorNum() == null : this.getFavorNum().equals(other.getFavorNum()))
            && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
            && (this.getToUserId() == null ? other.getToUserId() == null : this.getToUserId().equals(other.getToUserId()))
            && (this.getUserName() == null ? other.getUserName() == null : this.getUserName().equals(other.getUserName()))
            && (this.getToUserName() == null ? other.getToUserName() == null : this.getToUserName().equals(other.getToUserName()))
            && (this.getUserNickName() == null ? other.getUserNickName() == null : this.getUserNickName().equals(other.getUserNickName()))
            && (this.getToUserNickName() == null ? other.getToUserNickName() == null : this.getToUserNickName().equals(other.getToUserNickName()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getCommunicationId() == null) ? 0 : getCommunicationId().hashCode());
        result = prime * result + ((getCommentId() == null) ? 0 : getCommentId().hashCode());
        result = prime * result + ((getText() == null) ? 0 : getText().hashCode());
        result = prime * result + ((getToText() == null) ? 0 : getToText().hashCode());
        result = prime * result + ((getTime() == null) ? 0 : getTime().hashCode());
        result = prime * result + ((getLikeNum() == null) ? 0 : getLikeNum().hashCode());
        result = prime * result + ((getFavorNum() == null) ? 0 : getFavorNum().hashCode());
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        result = prime * result + ((getToUserId() == null) ? 0 : getToUserId().hashCode());
        result = prime * result + ((getUserName() == null) ? 0 : getUserName().hashCode());
        result = prime * result + ((getToUserName() == null) ? 0 : getToUserName().hashCode());
        result = prime * result + ((getUserNickName() == null) ? 0 : getUserNickName().hashCode());
        result = prime * result + ((getToUserNickName() == null) ? 0 : getToUserNickName().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", communicationId=").append(communicationId);
        sb.append(", commentId=").append(commentId);
        sb.append(", text=").append(text);
        sb.append(", toText=").append(toText);
        sb.append(", time=").append(time);
        sb.append(", likeNum=").append(likeNum);
        sb.append(", favorNum=").append(favorNum);
        sb.append(", userId=").append(userId);
        sb.append(", toUserId=").append(toUserId);
        sb.append(", userName=").append(userName);
        sb.append(", toUserName=").append(toUserName);
        sb.append(", userNickName=").append(userNickName);
        sb.append(", toUserNickName=").append(toUserNickName);
        sb.append(", status=").append(status);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}